<?php


class VodAttributeSet extends CActiveRecord
{
	
	public static function model($Vgmajjibziuy=__CLASS__)
	{
		return parent::model($Vgmajjibziuy);
	}

	
	public function tableName()
	{
		return 'vod_attribute_set';
	}

	
	public function rules()
	{
		
		
		return array(
			array('code_name, display_name', 'required'),
			array('create_user_id, modify_user_id', 'numerical', 'integerOnly'=>true),
			array('code_name, display_name', 'length', 'max'=>100),
			array('description, create_date, modify_date', 'safe'),
			
			
			array('id, code_name, display_name, description, create_date, modify_date, create_user_id, modify_user_id', 'safe', 'on'=>'search'),
		);
	}

	
	public function relations()
	{
		
		
		return array(
			'vodAttributeAttributeSetMappings' => array(self::HAS_MANY, 'VodAttributeAttributeSetMapping', 'vod_attribute_set_id'),
			'createUser' => array(self::BELONGS_TO, 'BackendUser', 'create_user_id'),
			'modifyUser' => array(self::BELONGS_TO, 'BackendUser', 'modify_user_id'),
			'vodCategories' => array(self::HAS_MANY, 'VodCategory', 'vod_attribute_set_id'),
		);
	}

	
	public function attributeLabels()
	{
		return array(
			'id' => 'ID',
			'code_name' => 'Code Name',
			'display_name' => 'Display Name',
			'description' => 'Description',
			'create_date' => 'Create Date',
			'modify_date' => 'Modify Date',
			'create_user_id' => 'Create User',
			'modify_user_id' => 'Modify User',
		);
	}

	
	public function search()
	{
		
		

		$V0v5vsnfxezw=new CDbCriteria;

		$V0v5vsnfxezw->compare('id',$this->id);
		$V0v5vsnfxezw->compare('code_name',$this->code_name,true);
		$V0v5vsnfxezw->compare('display_name',$this->display_name,true);
		$V0v5vsnfxezw->compare('description',$this->description,true);
		$V0v5vsnfxezw->compare('create_date',$this->create_date,true);
		$V0v5vsnfxezw->compare('modify_date',$this->modify_date,true);
		$V0v5vsnfxezw->compare('create_user_id',$this->create_user_id);
		$V0v5vsnfxezw->compare('modify_user_id',$this->modify_user_id);

		return new CActiveDataProvider($this, array(
			'criteria'=>$V0v5vsnfxezw,
		));
	}
}